/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.posplus.losspreventiondataimporter.service;

import com.posplus.lossprevention.APDAOFactory;
import com.posplus.lossprevention.dao.TransactionDetailsDAO;
import com.posplus.lossprevention.mapping.TransactionDetails;
import java.util.Iterator;
import java.util.List;

/**
 *
 * @author scottw
 */
public class TransactionDetailsService {

    private TransactionDetailsDAO detailDAO;
    
    public TransactionDetailsService(APDAOFactory lpFactory) {
        this.detailDAO = lpFactory.getTransactionDetailsDAO();
    }
    
    public TransactionDetailsService(TransactionDetailsDAO detailDAO){
        this.detailDAO = detailDAO;
    }

    public void bulkInsert(List<TransactionDetails> transactionDetails) {
        detailDAO.bulkInsert(transactionDetails);
    }

    public void saveAll(List<TransactionDetails> transactionDetails) {
        Iterator<TransactionDetails> iter = transactionDetails.iterator();
        while (iter.hasNext()) {
            detailDAO.save(iter.next());
            
        }
    }
    
}
